package com.sinoglobal.wallet.util;

import com.sinoglobal.wallet.app.SinoApplication;

import android.util.Log;


/**
 * Log工具类 d e i v w五种打印 Log功能默认关闭。需要手动更改DEBUG的值
 * 
 * @author KEZHUANG
 */
public class LogUtils {
	
	public static final boolean DEBUG = SinoApplication.sLogSwitch;
	public static final String TAG = SinoApplication.sLogTag;

	public static void i(Object object) {
		if (SinoApplication.sLogSwitch) {
			if (object == null) {
				i("标签" + TAG + "的打印内容为空！");
			}
			Log.i(TAG, object.toString());
		}
	}

	public static void d(Object object) {
		if (DEBUG) {
			if (object == null) {
				d("标签" + TAG + "的打印内容为空！");
			}
			Log.d(TAG, object.toString());
		}
	}

	public static void e(Object object) {
		if (DEBUG) {
			if (object == null) {
				e("标签" + TAG + "的打印内容为空！");
			}
			Log.e(TAG, object.toString());
		}
	}

	public static void v(Object object) {
		if (DEBUG) {
			if (object == null) {
				v("标签" + TAG + "的打印内容为空！");
			}
			Log.v(TAG, object.toString());
		}
	}

	public static void w(Object object) {
		if (DEBUG) {
			if (object == null) {
				w("标签" + TAG + "的打印内容为空！");
			}
			Log.w(TAG, object.toString());
		}
	}
	
	 public static void e(Object object, Throwable tr) {
	        if (DEBUG){
	        	if (object == null) {
					e("标签" + TAG + "的打印内容为空！");
				}
	        	Log.e(TAG, object.toString(), tr);
	        }
	    }
}
